from tools.computer_operator import PyAutoGUIController

controller = PyAutoGUIController(selected_screen=0, is_scaling=True, pause_time=1)


async def main():
    import time
    time.sleep(1)

    keys = "win+r"
    await controller(action="key", text=keys)
    print(f"call keyboard shortcuts {keys}")

    text = "cmd"
    await controller(action="type", text=text)
    print(f"Type text: {text}")

    keys = "enter"
    await controller(action="key", text=keys)
    print(f"call keyboard shortcuts {keys}")

    text = "ipconfig"
    await controller(action="type", text=text)
    print(f"Type text: {text}")

    keys = "enter"
    await controller(action="key", text=keys)
    print(f"call keyboard shortcuts {keys}")

    screenshot_path = await controller(action="screenshot")
    print(f"save screenshot to {screenshot_path}")

if __name__ == '__main__':
    import asyncio

    asyncio.run(main())

"""
1、Keys "Win+R" shortcuts
2、Type "cmd"
3、Keys "Enter" shortcuts
4、Type "ipconfig"
5、Keys "Enter" shortcuts
6、screenshot
"""
